<template>
	<view class="container">
		<view class="title">标题:{{item.title}}</view>
		<view class="time">通知时间:{{item.addtime}}</view>
		<text class="msgdetail">消息详情</text>
		<jyf-parser :html="item.name" class="content"></jyf-parser>
	</view>
</template>

<script>
	import jyfParser from "@/components/jyf-parser/jyf-parser";
	import {getIndexInfo} from '@/request/index'
	export default {
		components:{
			jyfParser
		},
		data() {
			return {
				item:'',
			}
		},
		onLoad(e) {
			console.log(e);
			if(e.type != 'my'){
				this.getIndexInfo(e.id)
			}else{
				// var item = JSON.parse(e.item);
				// console.log(item);
				// this.item.title = item.title
				// this.item.name = item.content
				// this.item.addtime = item.send_time
			}
		},
		methods: {
			getIndexInfo(id){
				const BASE_URL = uni.BASE_URL
				uni.request({
					url: BASE_URL+'index/notice/detail',
					data:{
						id:id
					},
					method:'POST', 
					success:(res) =>{
						console.log(res.data);
						this.item = res.data.data
					},
					fail:(res)=> {
						console.log(res.data);
					}
				});
			}
		}
	}
</script>

<style class="less" scoped>
	.container{
		padding: 20upx 15upx;
		background-color: #eee;
		
	}
.title{
	padding: 20upx 0;
	font-size: 35upx;
	font-weight: 700;
}
.time{
	padding: 20upx 0;
	font-size: 28upx;
	font-weight: 700;
	color: #555;
}
.msgdetail{
	padding: 20upx 0;
	font-size: 30upx;
	font-weight: 700;
	border-bottom: 6upx solid deepskyblue;
}
.content{
	margin-top: 50upx;
	letter-spacing: 5upx;
}
</style>
